import re,pyperclip
def hexstr(string):
    return str(hex(ord(string))).replace("0x","",1)
def string2hex(string):
    result=""
    for i in string:
        result+=hexstr(i)
    return result
def hex2doge(hexstring):
    result=""
    dogedict={
        " ":"woof",
        "0":"wooa",
        "1":"rrrw",
        "2":"wuff",
        "3":"wooo",
        "4":"woff",
        "5":"woaa",
        "6":"wofff",
        "7":"rooa",
        "8":"rowa",
        "9":"rrrr",
        "a":"woot",
        "b":"woft",
        "c":"wrra",
        "d":"wora",
        "e":"woofff",
        "f":"wofffff"
    }
    for i in hexstring:
        result+=dogedict[i]
        result+=" "
    return result
def doge2hex(doge):
    rdogedict={
        " ":"woof",
        "0":"wooa",
        "1":"rrrw",
        "2":"wuff",
        "3":"wooo",
        "4":"woff",
        "5":"woaa",
        "6":"wofff",
        "7":"rooa",
        "8":"rowa",
        "9":"rrrr",
        "a":"woot",
        "b":"woft",
        "c":"wrra",
        "d":"wora",
        "e":"woofff",
        "f":"wofffff"
    }
    dogedict={}
    for key,val in rdogedict.items():
        dogedict[val]=key
    dl=doge.split(" ")
    rs=""
    for i in dl:
        if i!="":
            rs+=dogedict[i]
    result = re.sub(r"(?<=\w)(?=(?:\w\w)+$)", " ", rs)
    result=result.split(" ")
    res=str()
    for i in result:
        res+=chr(int(eval(f"0x{i}")))
    return res